// YApi QuickType插件生成，具体参考文档:https://plugins.jetbrains.com/plugin/18847-yapi-quicktype/documentation

package com.xnfh.common.bean

import android.os.Parcel
import android.os.Parcelable
import java.util.ArrayList

data class UserInforBean(
    val moduleButton: ModuleButton?,
    val suOrganizeid: String?,
    val roleGroupNames: String?,
    val roleGroupIds: String?,
    val suAccount: String?,
    val suId: String?,
    val isAdmin: Long
): Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readParcelable(ModuleButton::class.java.classLoader),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readLong()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeParcelable(moduleButton, flags)
        parcel.writeString(suOrganizeid)
        parcel.writeString(roleGroupNames)
        parcel.writeString(roleGroupIds)
        parcel.writeString(suAccount)
        parcel.writeString(suId)
        parcel.writeLong(isAdmin)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<UserInforBean> {
        override fun createFromParcel(parcel: Parcel): UserInforBean {
            return UserInforBean(parcel)
        }

        override fun newArray(size: Int): Array<UserInforBean?> {
            return arrayOfNulls(size)
        }
    }
}

data class ModuleButton(
    val moduleList: ArrayList<ModuleList>?,
    val buttonList: ArrayList<ButtonList>?
):Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.createTypedArrayList(ModuleList),
        parcel.createTypedArrayList(ButtonList)
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeTypedList(moduleList)
        parcel.writeTypedList(buttonList)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<ModuleButton> {
        override fun createFromParcel(parcel: Parcel): ModuleButton {
            return ModuleButton(parcel)
        }

        override fun newArray(size: Int): Array<ModuleButton?> {
            return arrayOfNulls(size)
        }
    }
}

data class ButtonList (
    val organizeid: String?,
    val smbId: String?,
    val smbModuleid: String?,
    val smbEncode: String?,
    val isdeleted: Long,
    val createdat: String?,
    val smbSortcode: Long,
    val smbFullname: String?,
    val lastupdatedat: String?,
    val createdby: String?,
    val lastupdatedby: String?
):Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readLong(),
        parcel.readString(),
        parcel.readLong(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(organizeid)
        parcel.writeString(smbId)
        parcel.writeString(smbModuleid)
        parcel.writeString(smbEncode)
        parcel.writeLong(isdeleted)
        parcel.writeString(createdat)
        parcel.writeLong(smbSortcode)
        parcel.writeString(smbFullname)
        parcel.writeString(lastupdatedat)
        parcel.writeString(createdby)
        parcel.writeString(lastupdatedby)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<ButtonList> {
        override fun createFromParcel(parcel: Parcel): ButtonList {
            return ButtonList(parcel)
        }

        override fun newArray(size: Int): Array<ButtonList?> {
            return arrayOfNulls(size)
        }
    }
}

data class ModuleList (
    val smId: String?,
    val organizeid: String?,
    val smIsmenu: Long,
    val smFullname: String?,
    val isdeleted: Long,
    val createdat: String?,
    val smLayers: Long,
    val smIsexpand: Long,
    val lastupdatedat: String?,
    val createdby: String?,
    val smSortcode: Long,
    val lastupdatedby: String?,
    val smParentid: String?,
    val smTarget: String?,
    val deletedby: String? = null,
    val deletedat: String? = null
):Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readLong(),
        parcel.readString(),
        parcel.readLong(),
        parcel.readString(),
        parcel.readLong(),
        parcel.readLong(),
        parcel.readString(),
        parcel.readString(),
        parcel.readLong(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(smId)
        parcel.writeString(organizeid)
        parcel.writeLong(smIsmenu)
        parcel.writeString(smFullname)
        parcel.writeLong(isdeleted)
        parcel.writeString(createdat)
        parcel.writeLong(smLayers)
        parcel.writeLong(smIsexpand)
        parcel.writeString(lastupdatedat)
        parcel.writeString(createdby)
        parcel.writeLong(smSortcode)
        parcel.writeString(lastupdatedby)
        parcel.writeString(smParentid)
        parcel.writeString(smTarget)
        parcel.writeString(deletedby)
        parcel.writeString(deletedat)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<ModuleList> {
        override fun createFromParcel(parcel: Parcel): ModuleList {
            return ModuleList(parcel)
        }

        override fun newArray(size: Int): Array<ModuleList?> {
            return arrayOfNulls(size)
        }
    }
}

